package demeter;

import java.util.ArrayList;
import java.util.List;

public class Demeter {
    public static void main(String[] args) {
        demeter.Principal principal = new demeter.Principal();
        principal.printAll(new demeter.Teacher());
    }
}

/**
 * 校长
 */
class Principal{

    public List<demeter.Teacher> getAllTeacher(){
        List<demeter.Teacher> list = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            list.add(new demeter.Teacher(i));
        }
        return list;
    }

    public void printAll(demeter.Teacher teacher){
        List<demeter.Teacher> allTeacher = getAllTeacher();
        System.out.println("------所有老师编号-------");
        allTeacher.stream().map(demeter.Teacher::getId).forEach(System.out::println);
        List<demeter.Student> allStudent = teacher.getAllStudent();
        System.out.println("------所有学生编号-------");
        allStudent.stream().map(demeter.Student::getId).forEach(System.out::println);

    }


}
/**
 * 老师
 */
class Teacher{
    public Teacher() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    private Integer id;

    public Teacher(Integer id) {
        this.id = id;
    }

    public List<demeter.Student> getAllStudent(){
        List<demeter.Student> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add(new demeter.Student(i));
        }
        return list;
    }

}
/**
 * 学生
 */
class  Student{
    private Integer id;

    public Student(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
}